package com.e3.sysmg.security.client;

import java.util.List;

import com.e3.sysmg.security.model.ModuleModel;
import com.e3.sysmg.security.model.ModuleQC;
import com.e3.web.core.client.RPCServiceHelper;
import com.e3.web.core.client.WebException;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;

public interface ModuleRPCService extends RemoteService {
	public static class Util {
		private static ModuleRPCServiceAsync instance;
		public static ModuleRPCServiceAsync getInstance(){
			instance = (ModuleRPCServiceAsync)RPCServiceHelper.getService(ModuleRPCService.class.getName());
			if(instance == null){
				instance = GWT.create(ModuleRPCService.class);
				RPCServiceHelper.registerServiceEntryPoint(instance);
			}
			return instance;
		}
	}
	
	public ModuleModel newModule(ModuleModel moduleModel) throws WebException;
	
	public List<ModuleModel> getModulesByCondition(ModuleQC moduleQC) throws WebException;
		
	public ModuleModel modifyModule(ModuleModel moduleModel) throws WebException;
	
	public void deleteModules(List<ModuleModel> moduleModels) throws WebException;
	
	public List<ModuleModel> getModuleChildren(ModuleModel moduleModel) throws WebException;
	
	public ModuleModel getModuleByCode(String code) throws WebException;
	
	public ModuleModel getModuleById(String id) throws WebException;
}
